E2604. Finish Password Resets#302
Open
johnmweisz wants to merge 81 commits into
Open
Conversation
…smpt pass in development.rb and configuring the mailer
# Conflicts: # README.md # app/controllers/passwords_controller.rb # app/models/user.rb # config/routes.rb
E2604 password reset
- Using I18n locales for text that would be displayed to the user - this allows us a central location to have messages while giving the possibility of adding more languages in the future - moved the user out of factories.rb and into factories/user.rb to centralize the user factory - added a password_reset_user factory that extends the user factory to be able to test password resets - updating the passwords controller and user_mailer to use the I18n text ## passwords_controller_spec.rb - had to fix the controller being referenced (API::V1) No longer exists - changed user to the password_reset_user - had to remove tests that are no longer valid - updated the reset email check to verify the token is sent - updated the invalid user response to match the new response - When testing updating the password, added in a token for testing - added in a check to ensure the password updated properly
…igurable #7 make baseurl configurable, align email and template
The unit tests weren't working, so made updates to get them working
Need time_helpers to be included for travel_to to work for testing expired tokens.
remove creds and update subject
needed to add time_helpers to th rails_helper
- The user tests had tests no longer valid for the password reset. - Removed 3 tests from the user_spec.rb file ## User mailer - split out the token url to a helper method for better testing - wrote an rspec test to cover the user_mailer
…tests Cleaning up user tests and adding mailer tests
… password forgot/reset still works.
Tests updated to be more robust for token searching. Tests to come.
Refine the PW reset controller
- updated .gitignore to not capture .env and .env.* files - added FRONTEND_(SCHEME|DOMAIN|PORT) to sample.env with descriptions about each - updated the README.md file to include environment setup since this configuration will be important going forward - updated the user_mailer.rb to use the new FRONTEND_URL constant from environment.rb ## environment.rb - we add the frontend configuration to the environment.rb file - defaults are read from each environment config, but can be overridden by the .env file - If the FRONTEND_DOMAIN isn't set, then we raise a configuration error - dev/test set the frontend port to 3000 by default - if the scheme has a standard port we don't add it to the url, but if it isn't a standard port and isn't nil then we append it to the frontend url
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Making sure that the FRONTEND_URL is included in the email body
ensuring that we test the frontend url and link to contain the frontend url and reset token
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
with rails using config.x.<variable> is preferred for custom settings
…nfig Making FRONTEND_URL use environment settings as requested
in the readme the section regarding setting env variable ended up with missing data This was caused from a batch suggestion apply of copilot in GitHub
readme update was messed up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the backend portion of password reset functionality.
Frontend PR is here: expertiza/reimplementation-front-end#153
Feature detail can be reviewed here: https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2026_-_E2604._Finish_Password_Resets
Issue: #264
Notes